﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Pavilion.DesignerTool
{
    public class XnaTimer
    {
        public GameTime GameTime { get; private set; }
        private DateTime dateTime;
        private TimeSpan totalGameTime;

        public XnaTimer()
        {
            GameTime = new GameTime();
        }

        public void Update()
        {
            DateTime currentTime = DateTime.Now;
            TimeSpan timespan = currentTime - dateTime;
            dateTime = currentTime;

            totalGameTime = totalGameTime.Add(timespan);
            GameTime = new GameTime(totalGameTime, timespan);
        }
    }
}
